package artid.com.artc.adapter;


import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import artid.com.artc.R;


/**
 * 文 件 名: MainBooksAdapter
 * 创 建 人: Allen
 * 创建日期: 16/12/24 19:55
 * 邮   箱: AllenCoder@126.com
 * 修改时间：
 * 修改备注：
 */
public class SPAuctionPreviewAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    private Context mContext;

    public SPAuctionPreviewAdapter(Context mContext, List<String> list) {
        super(R.layout.item_sp_auction_preview, list);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        TextView tv = (TextView) helper.getView(R.id.tv_auction_status);
        ImageView iv = (ImageView) helper.getView(R.id.iv_auction_status);
        Log.e("convert", "getLayoutPosition=" + helper.getLayoutPosition());
        switch (helper.getLayoutPosition() % 3) {
            case 0:
                tv.setText("拍卖中");
                tv.setBackgroundResource(R.drawable.solid_red);
                iv.setVisibility(View.GONE);
                break;
            case 1:
                tv.setText("待开始");
                tv.setBackgroundResource(R.drawable.solid_green);
                iv.setVisibility(View.VISIBLE);
                iv.setImageResource(R.drawable.sc_btn_tixing);
                break;
            case 2:
                tv.setText("距开始8分22秒");
                tv.setBackgroundResource(R.drawable.solid_green);
                iv.setVisibility(View.VISIBLE);
                iv.setImageResource(R.drawable.sc_btn_tixing_sel);
                break;
            default:
                break;
        }
    }


}
